Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: OpenDoc Class Reference /
Part 1 - Classes and Methods


ODDispatchModule

Superclasses
ODObject
Subclasses
none

An object of the ODDispatchModule class is used to distribute one or more event types.

Description

Part editors do not receive events directly from the operating system; rather, OpenDoc receives events, interprets them, and dispatches them, using the dispatcher, to the appropriate part editor. The dispatcher uses dispatch module objects to dispatch specific events to individual parts. The dispatcher uses at least one internal dispatch module to handle standard events--such as mouse clicks, keystrokes, and menu commands--of a particular platform. Typically, you do not need to subclass ODDispatchModule or even access the internal dispatch module directly. However, you can extend the OpenDoc dispatching system by installing additional dispatch modules.

The ODDispatchModule class is an abstract superclass that you can subclass to create a dispatch module. You can define dispatch modules to distribute new types of events or messages, such as the custom events generated by a data glove or pen, to your part editor. Each dispatch module is responsible for determining the frame or part to which it dispatches an event.

You can create a dispatch module object either from within a shell plug-in or from within one of your part's methods that are called during startup.

Your part editor can also install a dispatch module as a monitor, using the dispatcher's AddMonitor method (page 114). In this case, you can monitor the event stream without interfering with it. By registering a dispatch module as a monitor for a specified event type, OpenDoc notifies the dispatch module when an event of that type occurs. You might use a monitor in a debugging environment to monitor events and display a log of the events in a window. There can be one or more monitors for each event type.

For more information related to the dispatcher, see the ODDispatcher class description (page 110). For more information on event handling in OpenDoc, see the chapter on user events in the OpenDoc Programmer's Guide for the MacOS.

Overriding Inherited Methods

The following methods are inherited and available for use by your subclass of ODDispatchModule.

somInit

The somInit method initializes the instance variables in a System Object Model(TM) (SOM(TM)) object; it is inherited from the SOMObject class.

If you subclass ODDispatchModule, you can override this method. Your override method does not need to call its inherited method; the inherited method is automatically called for you by the SOM library.

Your override of this method should initialize the new instance variables in this dispatch module object. The SOM library calls this method when this dispatch module is created. You must not do anything that might fail in this method. This limits you to operations like setting pointer variables to null, setting numeric variables to appropriate values, and making similar assignments from constants. If you have any initialization code that can potentially fail, it must be handled in this dispatch module's subclass-specific initialization method; see also the InitDispatchModule method (page 130).

somUninit

The somUninit method disposes of the storage created for a SOM object; it is inherited from the SOMObject class.

If you subclass ODDispatchModule, you can override this method. Your override method does not need to call its inherited method; the inherited method is automatically called for you by the SOM library.

Your override of this method should dispose of any storage created for this dispatch module object, including any storage related to additional instance variables initialized in this dispatch module object. The SOM library calls this method when this dispatch module is deleted; this method must not fail.

Methods

This section presents summary descriptions of the ODDispatchModule methods grouped according to purpose, followed by detailed descriptions in alphabetical order.

InitDispatchModule
Initializes this dispatch module object.
Dispatch
Should dispatch the specified event to the appropriate part.

Methods
Dispatch
InitDispatchModule

Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help